export {};

// 类与接口

// 我们往往将每个功能拆分出来,定义一个一个接口
interface Eat {
  eat: Function;
  // eat(food: string): void;
  // run(distance: string): void;
}

interface Run {
  run: Function;
}

//人类
class Person implements Eat, Run {
  if() {}
  eat(food: string): void {
    console.log(`优雅的进餐:${food}`);
  }
  run(distance: string): void {
    console.log(`直行:${distance}`);
  }
}

// 动物类
class Animal implements Eat, Run {
  eat(food: string): void {
    console.log(`呼噜呼噜的吃:${food}`);
  }
  run(distance: string): void {
    console.log(`爬行:${distance}`);
  }
}

let person = new Person();

console.log(person.eat("牛肉"));
let animal = new Animal();
